<template>
  <view class="h-full w-full bg-[#FFFFFF]">
    <web-view :src="url" :update-title="true" />
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const url = ref(route.query.url as string || '')
const title = ref(route.query.title as string || '')
definePage({
  style: {
    navigationBarBackgroundColor: '#FFFFFF',
  },
  excludeLoginPath: true, // ← 关键字段

})
onMounted(() => {
  // 动态设置导航栏标题 —— 这才是正确姿势
  if (title.value) {
    uni.setNavigationBarTitle({
      title: title.value,
    })
  }
})
</script>

<style>
.webview-container {
  width: 100%;
  height: 100%;
}
</style>
